﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyServer.Todo.Infrastructure.DatabaseContext.EntityConfigurations
{
    public class TodoSettingsConfig : IEntityTypeConfiguration<TodoSettings>
    {
        public void Configure(EntityTypeBuilder<TodoSettings> builder)
        {

            builder.ToTable("todo_settings");

            builder.HasKey(_ => _.Id);
            builder.Property(_ => _.Id)
                .HasColumnName("id")
                .HasMaxLength(36)
                .IsRequired();

            builder.Property(_ => _.IsMyDay).HasColumnName("is_myday");
            builder.Property(_ => _.Category).HasColumnName("category");
            builder.Property(_ => _.ExpirationDate).HasColumnName("expiration_date");
            builder.Property(_ => _.IsImportant).HasColumnName("is_important");

        }
    }
}
